<template>
	<view class="page-container">
		<use-navbar ref="navbar" type="custom" :show="true" :back="true" :bg-color="navbarBgcolor">
			<template v-slot:title>
				<view class="tac">
					<text class="ft-dark-3 fs-30">{{title}}</text>
				</view>
			</template>
		</use-navbar>
		<web-view style="position: fixed;top:0;left: 0;width: 100vw;height: 100vh;"
				:src="unityWebUrl" full-screen ref="unityWindows"></web-view>
		
	</view>
</template>

<script setup>
	// --组合式 API 模板
	import {
		ref,
		reactive,
		provide,
		onMounted,
		computed,
		getCurrentInstance
	} from 'vue'
	import {
		onLoad,
		onShow,
	} from "@dcloudio/uni-app";
	import {
		storeToRefs
	} from 'pinia';
	import {
		useUserStore
	} from '@/store'

	const {
		ctx,
		proxy
	} = getCurrentInstance();
	console.log("ctx", ctx);

	let UserStore = useUserStore()
	provide('location', 'North Pole')
	const title = ref("流水账记录")
	const navbarBgcolor = ref('#f1f1f1')
	
	const unityWebUrl=ref('https://mcda.youerp.cn/web/WebGl/Details/index.html')
	// onLoad 接受 A 页面传递的参数
	onLoad((option) => {
		console.log("B 页面 onLoad:", option); //B 页面 onLoad: {id: '1', name: 'uniapp'}
		// unityWebUrl.value='http://localhost:8039/WebGl/Details/index.html?v=1.0.0'
		
	});

	onShow(() => {
		console.log("B 页面 onShow");
	});

	const init = () => {
		if (!_id.value) return;
	
	}

	onMounted(() => {})
</script>

<style lang="scss" scoped>
	page,
	.page-container {
		background-color: $uni-bg-color-grey;
		min-height: 100vh;
	}

	.uni-forms-item {
		margin-bottom: 7.5px;
	}

	.edit-area {
		width: 80vw;
		padding: 100rpx 80rpx 45rpx 80rpx;
		margin-top: 20vh;
		margin-left: 10vw;
		margin-right: 10vw;
		margin-bottom: 5px;

		.field {
			background-color: #f5f5f5;
		}
	}


	// --操作区
	.oper-area {
		left: 0;
		bottom: 0;
		box-shadow: 0 0 20rpx 0 #f0f0f0;
		height: 100rpx;
		height: calc(env(safe-area-inset-bottom) + 100upx);
		z-index: 95;

		.btn-area {
			background: rgba(255, 255, 255, 0.95);

			.btn {
				font-size: 24upx;
				color: 75787d;
			}

			.iconfont {
				font-size: 40rpx;
				line-height: 48rpx;
			}
		}
	}

	.customer {
		.headimg.big {
			width: 65px;
			height: 65px;
			background-color: #f5f5f5;

			.avatar {
				max-width: 100%;
				height: 100%;
			}
		}
	}

	.stats-area {
		.item {
			padding: 5rpx 0 5rpx 0;

			.headimg {
				width: 25px;
				height: 25px;
			}
		}

		.num {
			font-size: 14px;
			color: #3a3a3a;
			margin-bottom: 6rpx;
		}
	}

	.uni-progress-bar {}
</style>